﻿using Abp.Domain.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yozeev.BusinessLogic;

namespace Yozeev.Controllers.Stats.Filters
{
    public class WharfFilter : AbstractFilter
    {
        private readonly IRepository<Wharf, Guid> _wharfRep;

        public WharfFilter(IRepository<Wharf, Guid> wharfRep)
        {
            _wharfRep = wharfRep;
        }

        public override void Decorate(Dictionary<string, IEnumerable<object>> Data)
        {
            if (Data.ContainsKey("Wharves")) return;
            var wharves = _wharfRep.GetAll();
            Data.Add("Wharves", wharves.ToList());
        }
    }
}
